package com.example.job.Model

import android.os.Parcel
import android.os.Parcelable

data class JobModel(
    val id:Int,
    val title:String="",
    val company:String="",
    val type:String="",
    val minsalary:String="",
    val maxsalary:String="",
    val experience:String="",
    val edu:String="",
    val tag:String="",
    val people:String="",
    val flag:String="",
    val welfare:String="",
    val img:String="",
    val city:String=""
):Parcelable{
    constructor(parcel: Parcel) : this(
        parcel.readInt(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(id)
        parcel.writeString(title)
        parcel.writeString(company)
        parcel.writeString(type)
        parcel.writeString(minsalary)
        parcel.writeString(maxsalary)
        parcel.writeString(experience)
        parcel.writeString(edu)
        parcel.writeString(tag)
        parcel.writeString(people)
        parcel.writeString(flag)
        parcel.writeString(welfare)
        parcel.writeString(img)
        parcel.writeString(city)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<JobModel> {
        override fun createFromParcel(parcel: Parcel): JobModel {
            return JobModel(parcel)
        }

        override fun newArray(size: Int): Array<JobModel?> {
            return arrayOfNulls(size)
        }
    }

}
